package com.sanery.ui.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sanery.entity.User;
import com.sanery.service.UserService;

@Controller
public class UserController {

	@Resource(name = "userService")
	private UserService service = null;

	@RequestMapping(value = "/login", method = RequestMethod.POST)
	@ResponseBody
	public User login(String username, String password) {
		User user = service.getUser(username, password);
		return user;
	}
}
